/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-  */
/*
 * catchit
 * Copyright (C) 2013 Ryan Grinkewitz <graphite@Toto>
 * 
catchit is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * catchit is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _SPRITE_MANAGER_H_
#define _SPRITE_MANAGER_H_

#include <string>
#include "math.h"
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
//#include "game-state.h"

class SpriteManager
{
public:

//	static SpriteManager* getInstance();

	//sprite_sheet - file name of the sprite sheet
	//sprite_size - size of a sprite in pixels
	//sheet_size - number of sprites to a side, i.e. 16
	//sprites will be placed in an array of surfaces which can
	//be indexed into
	//returns 1 on success
	int loadSpriteSheet(std::string sprite_sheet, int sprite_size, 
	                    int sheet_size);

	//int loadSpriteSheet(std::string sprite_sheet, 	
	int loadSpriteSheet(std::string sprite_sheet, std::string sprite_map);

	//sprite_index - index of the sprite to be displayed
	//x - x coordinate to display the sprite
	//y - y coordinate to display the sprite
	//display_surface - sdl surface to blit the sprite to
	int displaySprite(int sprite_index, int x, int y, 
	                  SDL_Surface* display_surface);

	
	int getSpriteSize();
	int getSpriteCount();

	//void displayState(GameState* gameState);
	
	void displaySpriteSheetTest(SDL_Surface* screen, int width, 
                                           int height);
private:

	int sprite_count;
	int sprite_size;

	SDL_Rect* sprites;

	SDL_Surface* sprite_sheet_image;

//	SpriteManager(){};
//	SpriteManager(SpriteManager const&){};
//	SpriteManager& operator=(SpriteManager const&){};  
//	static SpriteManager* spriteManagerInstance;
};

#endif // _SPRITE_MANAGER_H_

